﻿<UserControl x:Class="EpiDashboard.Controls.GadgetMatchedPairPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:dashboard="clr-namespace:EpiDashboard"
             xmlns:Controls="clr-namespace:EpiDashboard.Controls"
             mc:Ignorable="d" 
             
             Width="Auto"
             Height="Auto"
             >
    <UserControl.Resources>
        <ResourceDictionary Source="../ResourceDictionary.xaml" />
    </UserControl.Resources>
    <Grid Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" SnapsToDevicePixels="True">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" MaxWidth="25"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="4"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="4"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>

        <Controls:MatchedPairPanel x:Name="panelSingleTableResults" Grid.Column="7" Grid.Row="0" Grid.RowSpan="3" HorizontalAlignment="Center" VerticalAlignment="Top" SnapsToDevicePixels="True"></Controls:MatchedPairPanel>
        <!--<Grid Name="grdResults" Grid.Column="7" Grid.Row="0" Grid.RowSpan="3" Width="Auto" Height="Auto" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,0,0,0" Visibility="Visible" SnapsToDevicePixels="True">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
                <ColumnDefinition Width="15"></ColumnDefinition>
                <ColumnDefinition Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Border Grid.Row="0" Grid.ColumnSpan="3" Style="{DynamicResource gridCellBorder}" BorderThickness="0,1,0,1">
                <TextBlock Grid.Row="0" FontWeight="Bold" Margin="0,1,0,1" HorizontalAlignment="Center" FontSize="14">Single Table Analysis</TextBlock>
            </Border>

            <Grid Grid.Row="1" Grid.Column="2" Margin="0,4,0,0" SnapsToDevicePixels="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="10"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>

                <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" FontWeight="Bold" HorizontalAlignment="Center">Statistical Tests</TextBlock>

                <TextBlock Margin="4,2,4,2" Grid.Row="1" Grid.Column="1" FontWeight="DemiBold" FontFamily="Pericles, Global User Interface" HorizontalAlignment="Center">X<Run Typography.Variants="Superscript">2</Run></TextBlock>
                <TextBlock Margin="4,2,4,2" Grid.Row="1" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">2 Tailed P</TextBlock>

                <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"></Border>

                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="0">Uncorrected</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="0">Mantel-Haenszel</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="0">Corrected</TextBlock>

                <TextBlock Name="txt1"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">49.7943</TextBlock>
                <TextBlock Name="txt2"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right">49.6556</TextBlock>
                <TextBlock Name="txt11"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right">49.6990</TextBlock>

                <TextBlock Name="txt3" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right">0.0000000000</TextBlock>
                <TextBlock Name="txt4" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Right">0.0000000000</TextBlock>
                <TextBlock Name="txt5" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Right">0.0000000000</TextBlock>


                <TextBlock Margin="4,2,4,2" Grid.Row="6" Grid.Column="1" FontWeight="DemiBold" HorizontalAlignment="Center">1 Tailed P</TextBlock>
                <TextBlock Margin="4,2,4,2" Grid.Row="6" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">2 Tailed P</TextBlock>

                <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="3"></Border>

                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="7" Grid.Column="0">Mid-P Exact</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="8" Grid.Column="0">Fisher Exact</TextBlock>

                <TextBlock Name="txt111"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="7" Grid.Column="1" HorizontalAlignment="Right">0.0000000002</TextBlock>
                <TextBlock Name="txt2111"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="8" Grid.Column="1" HorizontalAlignment="Right">0.0000000003</TextBlock>                

                <TextBlock Name="txt31" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="7" Grid.Column="2" HorizontalAlignment="Right"></TextBlock>
                <TextBlock Name="txt41" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="8" Grid.Column="2" HorizontalAlignment="Right">0.0000000003</TextBlock>
            </Grid>

            <Grid Grid.Row="1" Margin="0,4,0,0" SnapsToDevicePixels="True">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" x:Name="oddsColumn0" ></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                    <ColumnDefinition Width="Auto"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                    <RowDefinition Height="Auto"></RowDefinition>
                </Grid.RowDefinitions>

                <TextBlock Margin="4,2,4,2" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" FontWeight="Bold" HorizontalAlignment="Center">Odds- and Risk-based parameters</TextBlock>
                
                <TextBlock Margin="4,2,4,2" Grid.Row="1" Grid.Column="1" FontWeight="DemiBold" HorizontalAlignment="Center">Estimate</TextBlock>
                <TextBlock Margin="4,2,4,2" Grid.Row="1" Grid.Column="2" FontWeight="DemiBold" HorizontalAlignment="Center">Lower</TextBlock>
                <TextBlock Margin="4,2,4,2" Grid.Row="1" Grid.Column="3" FontWeight="DemiBold" HorizontalAlignment="Center">Upper</TextBlock>

                <Border BorderThickness="0,0,0,1" BorderBrush="DarkGray" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3"></Border>

                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="0">Odds ratio</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="0">MLE Odds ratio (Mid-P)</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="0">Fisher-Exact</TextBlock>

                <TextBlock Name="txtOddsRatioEstimate"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Right">12.8417</TextBlock>
                <TextBlock Name="txtMidPEstimate"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="1" HorizontalAlignment="Right">12.7119</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="1" HorizontalAlignment="Right"></TextBlock>

                <TextBlock Name="txtOddsRatioLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="2" HorizontalAlignment="Right">5.4788</TextBlock>
                <TextBlock Name="txtMidPLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="2" HorizontalAlignment="Right">5.5340</TextBlock>
                <TextBlock Name="txtFisherLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="2" HorizontalAlignment="Right">5.1853</TextBlock>

                <TextBlock Name="txtOddsRatioUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="2" Grid.Column="3" HorizontalAlignment="Right">30.0995</TextBlock>
                <TextBlock Name="txtMidPUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="3" Grid.Column="3" HorizontalAlignment="Right">31.5541</TextBlock>
                <TextBlock Name="txtFisherUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="4" Grid.Column="3" HorizontalAlignment="Right">34.5379</TextBlock>

                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="0">Risk ratio</TextBlock>
                <TextBlock Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="6" Grid.Column="0">Risk difference</TextBlock>

                <TextBlock Name="txtRiskRatioEstimate"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="1" HorizontalAlignment="Right">12.8417</TextBlock>
                <TextBlock Name="txtRDEstimate"  Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="6" Grid.Column="1" HorizontalAlignment="Right">12.7119</TextBlock>

                <TextBlock Name="txtRiskRatioLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="2" HorizontalAlignment="Right">5.4788</TextBlock>
                <TextBlock Name="txtRDLower" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="6" Grid.Column="2" HorizontalAlignment="Right">5.5340</TextBlock>

                <TextBlock Name="txtRiskRatioUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="5" Grid.Column="3" HorizontalAlignment="Right">30.0995</TextBlock>
                <TextBlock Name="txtRDUpper" Style="{DynamicResource twoByTwoSingleTableTextBlockStyle}" Grid.Row="6" Grid.Column="3" HorizontalAlignment="Right">31.5541</TextBlock>
            </Grid>
        </Grid>-->

        <Grid Name="grdGraph" Grid.Column="5" Grid.Row="2" Width="150" Height="150" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0" Visibility="Visible">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="75"/>
                <ColumnDefinition Width="75"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="75"/>
                <RowDefinition Height="75"/>
            </Grid.RowDefinitions>
            <Rectangle Name="rctRed" Width="0" Height="1" Grid.Row="0" Grid.Column="0" Fill="{DynamicResource redSquare}" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
            <Rectangle Name="rctOrange" Width="0" Height="1" Grid.Row="0" Grid.Column="1" Fill="{DynamicResource orangeSquare}" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
            <Rectangle Name="rctYellow" Width="0" Height="1" Grid.Row="1" Grid.Column="0" Fill="{DynamicResource yellowSquare}" HorizontalAlignment="Right" VerticalAlignment="Top"/>
            <Rectangle Name="rctGreen" Width="0" Height="1" Grid.Row="1" Grid.Column="1" Fill="{DynamicResource greenSquare}" HorizontalAlignment="Left" VerticalAlignment="Top"/>
        </Grid>

        <StackPanel Grid.Row="0" Grid.Column="2">
            <TextBlock x:Name="tblockTitle" HorizontalAlignment="Center" FontWeight="Bold" FontSize="18" Text="Title" Margin="0,0,0,10" Visibility="Collapsed"></TextBlock>            
            <TextBlock x:Name="tblockOutcome" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Center" FontWeight="Bold" FontSize="16" Text="Controls"></TextBlock>
        </StackPanel>

        <!--<TextBlock x:Name="tblockExposure1" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontSize="16" TextAlignment="Center" Margin="0" Text="Exposure"></TextBlock>-->

        <Canvas x:Name="exposureCanvas" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="25" Height="150" >
            <TextBlock x:Name="tblockExposure" Canvas.Bottom="53" Canvas.Left="2" FontWeight="Bold" FontSize="16" TextAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,-20" Text="Cases">                    
                <TextBlock.RenderTransform>
                    <TransformGroup>                                
                        <RotateTransform x:Name="rotate" Angle="270" />
                    </TransformGroup>
                </TextBlock.RenderTransform>
            </TextBlock>
        </Canvas>

        <Border Grid.Column="2" Grid.Row="2" Width="220" Height="160" CornerRadius="27" BorderBrush="Gray">
            <Border.Background>
                <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
                    <!--<GradientStop Color="#D9DAE5" Offset="0"></GradientStop>-->
                    <GradientStop Color="#DAE4F1" Offset="0"></GradientStop>
                    <!--<GradientStop Color="#F5F5FB" Offset="1"></GradientStop>-->
                    <GradientStop Color="#F1F5FA" Offset="1"></GradientStop>
                </LinearGradientBrush>
            </Border.Background>
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>

                <Border Grid.Row="0" Grid.Column="0" BorderThickness="0,0,1,1" BorderBrush="Gray">
                    <StackPanel VerticalAlignment="Center" Margin="2">
                        <TextBlock x:Name="tblockYYValue" Text="n/a" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontWeight="Regular" FontSize="32" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockYYRowP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockYYColP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                    </StackPanel>
                </Border>
                <Border Grid.Row="1" Grid.Column="0" BorderThickness="0,0,1,0" BorderBrush="Gray">
                    <StackPanel VerticalAlignment="Center" Margin="2">
                        <TextBlock x:Name="tblockNYValue" Text="n/a" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontWeight="Regular" FontSize="32" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockNYRowP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockNYColP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                    </StackPanel>
                </Border>
                <Border Grid.Row="0" Grid.Column="1" Margin="0,0,0,0" BorderThickness="0,0,0,1" BorderBrush="Gray">
                    <StackPanel VerticalAlignment="Center" Margin="2">
                        <TextBlock x:Name="tblockYNValue" Text="n/a" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontWeight="Regular" FontSize="32" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockYNRowP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockYNColP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                    </StackPanel>
                </Border>

                <Border Grid.Row="1" Grid.Column="1" Margin="0,0,0,0" BorderThickness="0,0,0,0" BorderBrush="Gray">
                    <StackPanel VerticalAlignment="Center" Margin="2">
                        <TextBlock x:Name="tblockNNValue" Text="n/a" HorizontalAlignment="Stretch" VerticalAlignment="Center" FontWeight="Regular" FontSize="32" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockNNRowP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                        <TextBlock x:Name="tblockNNColP" Text="00.00 %" Margin="0,0,8,0" Visibility="Visible" HorizontalAlignment="Right" VerticalAlignment="Center" FontSize="12" Foreground="Gray" TextAlignment="Center"></TextBlock>
                    </StackPanel>
                </Border>
            </Grid>
        </Border>

        <Grid Grid.Row="3" Grid.Column="2" Width="200" Margin="0, 0, 0, 0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <Border Grid.Column="0" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="0,0,1,0"></Border>
            <!--<Border Grid.Column="1" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="0,0,1,0"></Border>-->
            <StackPanel Grid.Row="0" Grid.Column="0">
                <TextBlock x:Name="tblockYTColCount" HorizontalAlignment="Center" Foreground="Gray" Margin="0,0,0,4" FontSize="16">n/a</TextBlock>
                <TextBlock x:Name="tblockYTRowP"  HorizontalAlignment="Right" Foreground="Gray" Margin="0,0,8,0" FontSize="12">00.00 %</TextBlock>
                <TextBlock x:Name="tblockCC1"  HorizontalAlignment="Right" Foreground="Gray" Margin="0,0,8,0" FontSize="12">100.00 %</TextBlock>
            </StackPanel>

            <StackPanel Grid.Row="0" Grid.Column="1">
                <TextBlock x:Name="tblockNTColCount" HorizontalAlignment="Center" Foreground="Gray" Margin="0,0,0,4" FontSize="16">n/a</TextBlock>
                <TextBlock x:Name="tblockNTRowP"  HorizontalAlignment="Right" Foreground="Gray" Margin="0,0,8,0" FontSize="12">00.00 %</TextBlock>
                <TextBlock x:Name="tblockCC2"  HorizontalAlignment="Right" Foreground="Gray" Margin="0,0,8,0" FontSize="12">100.00 %</TextBlock>
            </StackPanel>
                </Grid>

                <Grid Grid.Row="2" Grid.Column="3" Height="160"  Margin="0, 0, 0, 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                <Border Grid.Column="0" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="0,0,0,1"></Border>
                <!--<Border Grid.Column="0" Grid.Row="1" BorderBrush="DarkGray" BorderThickness="0,0,0,1"></Border>-->
                <StackPanel x:Name="panel1" Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom">
                    <TextBlock x:Name="tblockYTRowCount" Margin="5,0,0,0" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="Gray" FontSize="16">n/a</TextBlock>                        
                    <TextBlock x:Name="tblockRR1" Margin="5,0,0,0" VerticalAlignment="Center"  HorizontalAlignment="Right" Foreground="Gray" FontSize="12">100.00 %</TextBlock>
                <TextBlock x:Name="tblockYTColP" Margin="5,0,0,6" VerticalAlignment="Center"  HorizontalAlignment="Right" Foreground="Gray" FontSize="12">00.00 %</TextBlock>
                </StackPanel>
                <StackPanel x:Name="panel2" Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom">
                <TextBlock x:Name="tblockNTRowCount" Margin="5,0,0,0" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="Gray" FontSize="16">n/a</TextBlock>
                    <TextBlock x:Name="tblockRR2" Margin="5,0,0,0" VerticalAlignment="Center"  HorizontalAlignment="Right" Foreground="Gray" FontSize="12">100.00 %</TextBlock>
                <TextBlock x:Name="tblockNTColP" Margin="5,0,0,6" VerticalAlignment="Center" HorizontalAlignment="Right" Foreground="Gray" FontSize="12">00.00 %</TextBlock>
                    </StackPanel>
                </Grid>

                <Grid Grid.Row="3" Grid.Column="3" Margin="0, 0, 0, 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <StackPanel>
                        <TextBlock x:Name="tblockTotalCount" Margin="5,0,0,4" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center" FontWeight="Bold" Foreground="Gray" FontSize="16">n/a</TextBlock>
                        <TextBlock x:Name="tblockTotalPercent" Margin="5,0,0,0"  HorizontalAlignment="Right" Foreground="Gray" FontSize="12">100.00 %</TextBlock>
                <TextBlock x:Name="tblockTT" Margin="5,0,0,0"  HorizontalAlignment="Right" Foreground="Gray" FontSize="12">100.00 %</TextBlock>
            </StackPanel>
                </Grid>

                <Grid Grid.Row="2" Grid.Column="1" Height="160"  Margin="0, 0, 0, 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Border Grid.Column="0" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="0,0,0,1"></Border>
            <Canvas x:Name="canvasExposed" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="25" Height="75" >
                <TextBlock x:Name="tblockExposureYesLabel" Canvas.Left="0" Canvas.Top="0" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" 
                           Foreground="Gray" FontSize="12" Margin="0,60,0,0">
                    Exposed
                <TextBlock.RenderTransform>
                    <TransformGroup>                                
                        <RotateTransform x:Name="rotateExposed" Angle="270" />
                    </TransformGroup>
                </TextBlock.RenderTransform>
                </TextBlock>
            </Canvas>
            <Canvas x:Name="canvasNotExposed" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="25" Height="75" >
                <TextBlock x:Name="tblockExposureNoLabel" Canvas.Left="0" Canvas.Top="0" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" VerticalAlignment="Center" 
                           Foreground="Gray" FontSize="12" Margin="0,70,0,0">
                    Not Exposed
                <TextBlock.RenderTransform>
                    <TransformGroup>                                
                        <RotateTransform x:Name="rotateNotExposed" Angle="270" />
                    </TransformGroup>
                </TextBlock.RenderTransform>
                </TextBlock>
            </Canvas>
        </Grid>

                <Grid Grid.Row="1" Grid.Column="2" Width="220" Margin="0, 0, 0, 0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>

                    <Border Grid.Column="0" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="0,0,1,0"></Border>
                    <!--<Border Grid.Column="1" Grid.Row="0" BorderBrush="DarkGray" BorderThickness="0,0,1,0"></Border>-->
                <TextBlock x:Name="tblockOutcomeYesLabel" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Center" Foreground="Gray"  FontSize="12" Margin="2">Exposed</TextBlock>
                <TextBlock x:Name="tblockOutcomeNoLabel" Grid.Row="0" Grid.Column="1" HorizontalAlignment="Center" Foreground="Gray"  FontSize="12" Margin="2">Not Exposed</TextBlock>
                </Grid>

        <Grid HorizontalAlignment="Left" Grid.Column="3" Grid.Row="1" Name="grdShowPercents" Width="16" Height="16" Margin="1" Visibility="Visible" >
            <Rectangle x:Name="showPercentsRectangle" Style="{DynamicResource percentRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathShowPercents_MouseEnter" MouseLeave="PathShowPercents_MouseLeave" MouseLeftButtonUp="PathShowPercents_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipPercents">Shows or hides row and column percentages for this 2x2 table.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            <!--<Path x:Name="pathTriangle" Style="{StaticResource collapseTriangle}" IsHitTestVisible="False" Stretch="Fill" Width="6.878" Height="6.878" StrokeThickness="2" StrokeStartLineCap="Round" StrokeEndLineCap="Round"  />-->
            <!--<Path x:Name="pathTriangle" Style="{StaticResource percentsTriangle}" IsHitTestVisible="False" HorizontalAlignment="Center" VerticalAlignment="Center"
          StrokeLineJoin="Round"           
          Fill="White">
            </Path>-->
            <TextBlock IsHitTestVisible="False" HorizontalAlignment="Center" TextAlignment="Center" VerticalAlignment="Center" FontSize="10" FontWeight="Bold" Foreground="White">%</TextBlock>
            <!--M 5 10 L 0 0 10 0 Z    Expand arrow-->
            <!--M 5 0 L 10 10 0 10 Z   Collapse arrow -->
        </Grid>

        <Grid HorizontalAlignment="Left" Grid.Column="3" Grid.Row="1" Name="grdSwapOutcome" Width="16" Height="16" Margin="21, 1, 1, 1" Visibility="Visible" >
            <Rectangle x:Name="swapOutcomeRectangle" Style="{DynamicResource swapValuesRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathSwapOutcome_MouseEnter" MouseLeave="PathSwapOutcome_MouseLeave" MouseLeftButtonUp="PathSwapOutcome_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipSwapOutcome">Swaps the column positions for the outcome values. For example, if 'F' were on the left and 'T' were on the right, they would be switched.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>

            <Path x:Name="pathTriangleLeft" Data="M 0 3 L 6 0 6 6 Z" IsHitTestVisible="False" HorizontalAlignment="Center" Margin="2" VerticalAlignment="Top"
          StrokeLineJoin="Round" Fill="White" />

            <Path x:Name="pathTriangleRight" Data="M 6 3 L 0 6 0 0 Z" IsHitTestVisible="False" HorizontalAlignment="Center" Margin="2" VerticalAlignment="Bottom"
          StrokeLineJoin="Round" Fill="White" />
        </Grid>

        <Grid HorizontalAlignment="Left" Grid.Column="3" Grid.Row="1" Name="grdSwapExposure" Width="16" Height="16" Margin="41, 1, 1, 1" Visibility="Visible" >
            <Rectangle x:Name="swapExposureRectangle" Style="{DynamicResource swapValuesRectangle}"/>
            <Rectangle Opacity="0.5" Stroke="Transparent" Margin="1"  MouseEnter="PathSwapExposure_MouseEnter" MouseLeave="PathSwapExposure_MouseLeave" MouseLeftButtonUp="PathSwapExposure_MouseLeftButtonUp" >
                <Rectangle.ToolTip>
                    <ToolTip x:Name="toolTipSwapExposure">Swaps the row positions for the exposure values. For example, if 'F' were on the top and 'T' were on the bottom, they would be switched.</ToolTip>
                </Rectangle.ToolTip>
                <Rectangle.Fill>
                    <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                        <LinearGradientBrush.GradientStops>
                            <GradientStopCollection>
                                <GradientStop Color="white" Offset="0" />
                                <GradientStop Color="transparent" Offset="1" />
                            </GradientStopCollection>
                        </LinearGradientBrush.GradientStops>
                    </LinearGradientBrush>
                </Rectangle.Fill>
            </Rectangle>
            
            <Path x:Name="pathTriangleUp" Data="M 3 0 L 6 6 0 6 Z" IsHitTestVisible="False" HorizontalAlignment="Left" Margin="2" VerticalAlignment="Center"
          StrokeLineJoin="Round" Fill="White" />

            <Path x:Name="pathTriangleDown" Data="M 3 6 L 0 0 6 0 Z" IsHitTestVisible="False" HorizontalAlignment="Right" Margin="2" VerticalAlignment="Center"
          StrokeLineJoin="Round" Fill="White" />
            
        </Grid>

    </Grid>

</UserControl>
